package com.eventosgasteiz.server.bbdd;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class Event {

	public static final Character INSERT = 'I';
	public static final Character UPDATE = 'U';
	public static final Character DELETE = 'D';
	
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key id;

    @Persistent
	private Character option;
    @Persistent
	private Long version;
    @Persistent
	private String name;
    @Persistent
	private String desc;
    @Persistent
	private String lugar;
    @Persistent
	private String fecha_inicio;
    @Persistent
	private String fecha_fin;
    @Persistent
	private String horario;
    @Persistent
	private Double precio;
    @Persistent
	private String organizador;
    @Persistent
	private String telefono;
    @Persistent
	private String url;
    @Persistent
	private String photopath;
    @Persistent
	private String thumbphotopath;
    @Persistent
	private String location;
    @Persistent
	private Double latitude;
    @Persistent
	private Double longitude;
    
    
    
	public Event() {
		super();
		// TODO Auto-generated constructor stub
	}

	public Event(String name, String desc, String lugar,
			String fecha_inicio, String fecha_fin, String horario, Double precio,
			String organizador, String telefono, String url, String photopath,
			String thumbphotopath, String location, Double latitude,
			Double longitude) {
		super();
		this.option = Event.UPDATE;
		this.version = System.currentTimeMillis();
		this.name = name;
		this.desc = desc;
		this.lugar = lugar;
		this.fecha_inicio = fecha_inicio;
		this.fecha_fin = fecha_fin;
		this.horario = horario;
		this.precio = precio;
		this.organizador = organizador;
		this.telefono = telefono;
		this.url = url;
		this.photopath = photopath;
		this.thumbphotopath = thumbphotopath;
		this.location = location;
		this.latitude = latitude;
		this.longitude = longitude;
	}
	
	public Key getId() {
		return id;
	}
	public Character getOption() {
		return option;
	}
	public void setOption(Character option) {
		this.option = option;
		this.version = System.currentTimeMillis();
	}
	public Long getVersion() {
		return version;
	}
	public void setVersion(Long version) {
		this.version = version;
	}
	public void setVersion(){
		this.version = System.currentTimeMillis();
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
		this.version = System.currentTimeMillis();
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
		this.version = System.currentTimeMillis();
	}
	public String getLugar() {
		return lugar;
	}
	public void setLugar(String lugar) {
		this.lugar = lugar;
		this.version = System.currentTimeMillis();
	}
	public String getFecha_inicio() {
		return fecha_inicio;
	}
	public void setFecha_inicio(String fecha_inicio) {
		this.fecha_inicio = fecha_inicio;
		this.version = System.currentTimeMillis();
	}
	public String getFecha_fin() {
		return fecha_fin;
	}
	public void setFecha_fin(String fecha_fin) {
		this.fecha_fin = fecha_fin;
		this.version = System.currentTimeMillis();
	}
	public String getHorario() {
		return horario;
	}
	public void setHorario(String horario) {
		this.horario = horario;
		this.version = System.currentTimeMillis();
	}
	public Double getPrecio() {
		return precio;
	}
	public void setPrecio(Double precio) {
		this.precio = precio;
		this.version = System.currentTimeMillis();
	}
	public String getOrganizador() {
		return organizador;
	}
	public void setOrganizador(String organizador) {
		this.organizador = organizador;
		this.version = System.currentTimeMillis();
	}
	public String getTelefono() {
		return telefono;
	}
	public void setTelefono(String telefono) {
		this.telefono = telefono;
		this.version = System.currentTimeMillis();
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
		this.version = System.currentTimeMillis();
	}
	public String getPhotopath() {
		return photopath;
	}
	public void setPhotopath(String photopath) {
		this.photopath = photopath;
		this.version = System.currentTimeMillis();
	}
	public String getThumbphotopath() {
		return thumbphotopath;
	}
	public void setThumbphotopath(String thumbphotopath) {
		this.thumbphotopath = thumbphotopath;
		this.version = System.currentTimeMillis();
	}
	public String getLocation() {
		return location;
	}
	public void setLocation(String location) {
		this.location = location;
		this.version = System.currentTimeMillis();
	}
	public Double getLatitude() {
		return latitude;
	}
	public void setLatitude(Double latitude) {
		this.latitude = latitude;
		this.version = System.currentTimeMillis();
	}
	public Double getLongitude() {
		return longitude;
	}
	public void setLongitude(Double longitude) {
		this.longitude = longitude;
		this.version = System.currentTimeMillis();
	}

}